#ifndef VIDEOREOLAYWIDGET_H
#define VIDEOREOLAYWIDGET_H

#include <QWidget>
#include<QLabel>
#include<QPushButton>
#include<QStackedLayout>
#include<QListWidget>
#include<QHBoxLayout>
#include<QCalendarWidget>
#include <QMediaPlayer>
#include <QVideoWidget>
#include"contrl/mycontrol.h"
#include"ffmpeg/decodevideo.h"
#include<QPainter>
#include<QSlider>
#include<QComboBox>
#include"model/basemodel.h"
#include"contrl/mycontrol.h"
#include<QFileInfo>
#include"golob.h"
#include<QMessageBox>
class VideoReolayWidget : public QWidget
{
    Q_OBJECT
public:
    explicit VideoReolayWidget(QString path="",QWidget *parent = nullptr);

    void initUI();

    QString getPath() const;
    void setPath(const QString &value);

    void begin();

    QList<Video *> getList() const;
    void setList(const QList<Video *> &value);

    int getVideoIndex() const;
    void setVideoIndex(int value);

    float getSpeed() const;
    void setSpeed(float value);

signals:


    void ToSelect();
    void toSelect();


public slots:



    void reciverImage(QImage img,int x);
    void RetToSelect();

    void clipImage();//截图

    void onComboBoxIndexChanged(const QString &text);//调整速度

    void onNextCliked();
    void onPrevCliked();

    void ret();

private:
    QLabel *title;
    QPushButton*ret_button;
    QPushButton*begin_video;
    QLabel*screen;
    QPixmap*image;

     QPushButton *playBtn, *prevBtn, *nextBtn, *clipBtn;
     QComboBox *speedCombo;

    QHBoxLayout*layout_H1;
    QHBoxLayout*layout_H2;
    QHBoxLayout*layout_H3;
    QHBoxLayout*layout_H4;
    QHBoxLayout*layout_H5;

    QVBoxLayout*video_layoutV;
    QVBoxLayout*layout_V;
    DecodeVideo*decode2;

    int totalx=0;
    int x=0;
    QString path;



    QSlider*seekSlider;


    MyControl *con;
    BaseModel*model;

    bool isPlay=0;

    QList<Video*> list;
    int videoIndex;
    int st1=1;


    float speed=0;

    bool isFirstplay=0;


protected:
    void paintEvent(QPaintEvent *event);

};

#endif // VIDEOREOLAYWIDGET_H
